Regex strip all html tags excluding &

I would suggest this to you: +> i.e. , you keep in your html all the tags, which should not bother much. This is pretty hacky, but the regex engine will immediately skip a chunk of text starting with s, then with the rest, but I can't see an easy way to do that in your case without transforming the into something different as an intermediate step.

This expression works well except that it is ignoring all tags not just the ones that match up with – pagewil May 17 at 9:30.

Formally speaking you can't parse HTML with regex, because HTML is not a regular language. See also Can you provide some examples of why it is hard to parse XML and HTML with a regex? For some nightmare material.

Undoubtedly you can come up with some regexes that work in "most" situations, or "sensible" situations, but if you're sanitising user input via the regex this won't be sufficient. It's not a million miles away from trying to substitute SQL parameters via elaborate textual replacement and escaping; no matter how clever you are, the correct answer is to use a different approach as some weakness will still exist. In this case, that approach would be using an HTML parsing library to read the text, and then remove the and tags from the parsed DOM.(This is much more robust then trying to remove a sequence of characters from the raw text, and probably creates more understandable source code too!).

In fact, since you're probably talking about JS in the client, you already have the DOM available, pre-parsed by the browser, so this would be a simple operation. If you're unfamiliar with JavaScript's DOM manipulation methods, I consider the quirksmode intro to be approachable and informative.

The thing is I want to strip the tags but keep any text content that resides in these tags. I am experienced with jQuery but can see how to do this easily... – pagewil May 17 at 7:59 sorry typo : *can't – pagewil May 17 at 8:06.

How about: '); This would allow all br and all a-elements. Unforutantely in this function you don't have the possibility to allow/disallow element-properties like your class="user". This functions allways allows/disallows the specified elements with all properties.

This is a javscript issue not php. Thanks anyway. – pagewil May 17 at 8:07 Sorry, didn't check the tags :( – faileN May 17 at 8:28.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.